<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePromotionUserWithdrawalsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('promotion_user_withdrawals', function (Blueprint $table) {
            $table->increments('id');
            $table->string('shop_id', 20)->default('')->comment('商户ID');
            $table->string('user_id', 20)->default('')->comment('用户ID');
            $table->decimal('amount', 38, 4)->default(0)->comment('金额');
            $table->enum('status', ['success', 'fail'])->default('success')->comment('成功或失败');
            $table->string('reason')->default('success')->comment('成功或者失败原因');
            $table->integer('create_time')->default(0)->comment('创建时间');
            $table->integer('update_time')->default(0)->comment('更新时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('promotion_user_withdrawals');
    }
}
